package com.koo.modules.quartz.constant;

public enum AdminConstant {
    
    /**
     * 查询 sysStore 的最大同步时间 . <br>
     * 查询字段 : transportTime (MAX) <br>
     * 查询表 : sysStore <br>
     */
    ADMIN_SELECT_MAX_TRANSPORTDATE_SQL("查询 sysStore 的最大同步时间.","SELECT MAX(transport_time) as transportTime FROM sys_store;"),
    
    /**
     * 更新已经存在的门店信息. <br>
     * 更新字段: companyId = ?, storeType = ?, storeCode = ?, storeName = ?, storeFullName = ?, <br>
     * --|mobile = ?, contactor = ?, tel = ?, storeAddress = ?, status = ?, <br>
     * --|modifyDate = ?, remark = ?, transportTime = ? <br>
     * 更新表 : sysStore <br>
     * 更新条件 : storeId <br>
     */
    ADMIN_UPDATE_EXIST_STORE_SQL("更新已经存在的门店信息.", "UPDATE sys_store SET company_id = ?, store_type = ?, store_code = ?, store_name = ?, store_full_name = ?, mobile = ?, contactor = ?, tel = ?, store_address = ?, status = ?, modify_date = ?, remark = ?, transport_time = ? WHERE store_id = ? ;"),
    
    /**
     * 插入新的门店信息. <br>
     * 插入字段 : storeId, companyId, storeCode, storeType, storeName, <br>
     * --|storeFullName, contactor, tel, mobile, proviceCode, <br>
     * --|provinceName, cityCode, cityName, zoneCode, zoneName, storeAddress, <br>
     * --|status, createDate, modifyDate, remark, transportTime <br>
     * 插入表 : sysStore <br>
     * 插入数据 : {STORE_VALUES} --> values_1), (values_2), ... (values_n
     */
    ADMIN_INSERT_STORE_SQL("插入新的门店信息.","INSERT INTO sys_store (store_id, company_id, store_code, store_type, store_name, store_full_name, contactor, tel, mobile, province_name, city_name, zone_name, store_address, status, create_date, modify_date, remark, transport_time) VALUES ({STORE_VALUES}) ;"),
    /**
     * 全部门店环境数据库连接前缀. <br>
     * YAODIAN <br>
     * MIDDLE <br>
     */
    ALL_ENVIRONMENT_CONNECTION_PREFIXS("全部门店环境数据库连接前缀.", new String[] {
            B2BConstant.YAODIAN.getCompanyCode(), 
    }),
    
    /**
     * 全部公司的数据库前缀. <br>
     * GY <br>
     * BJA <br>
     */
    ALL_COMPANY_PREFIXS("全部公司的数据库前缀.", new String[] {
            B2BConstant.GY.getCompanyCode(), 
            B2BConstant.BJA.getCompanyCode(),
            B2BConstant.CX.getCompanyCode()
    }),
    
    ;
    private String sql;
    private String name;
    private String[] prefixDatas;

    AdminConstant(String name, String sql) {
        this.name = name;
        this.sql = sql;
    }
    
    private AdminConstant(String name, String[] prefixDatas) {
        this.name = name;
        this.prefixDatas = prefixDatas;
    }

    public String getSql() {
        return sql;
    }

    public String getName() {
        return name;
    }

    public String[] getPrefixDatas() {
        return prefixDatas;
    }

}
